﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.ComponentModel;

namespace Redboil.Bfp.Client.ViewModels {
    public class ViewModelBase : INotifyPropertyChanged, IDataErrorInfo {
        public ViewModelBase() {

        }

        /// <summary>
        /// INotifyPropertyChanged Member
        /// </summary>
        public event PropertyChangedEventHandler PropertyChanged;

        protected void OnPropertyChanged(string propertyName) {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            if (handler != null)
                handler(this, new PropertyChangedEventArgs(propertyName));
        }

        //public ValidationHandler validationHandler = new ValidationHandler();
        //public string Error {
        //    get { return null; }
        //}
        //public string this[string columnName] {
        //    get {
        //        if(this.validationHandler.BrokenRuleExists(columnName)) {
        //            return this.validationHandler[columnName];
        //        }
        //        return null;
        //    }
        //}
    }
}
